package com.esm.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.esm.service.DepartmentService;
import com.esm.serviceimpl.DepartmentServiceImpl;
import com.esm.utils.PrintWriterUtil;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

/**
 * SelectDeptNameController
 * 查询部门名称控制者
 * @author 魏长均
 *
 */
public class SelectDeptNameController_wcj extends HttpServlet
{
	private static final long serialVersionUID = 1L;
	DepartmentService dService = new DepartmentServiceImpl();
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException 
	{
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException 
	{
		JSONArray jao = dService.getDeptName();
		PrintWriter pw = resp.getWriter();
		PrintWriterUtil.flushJaoAndClosePrintWriter(pw, jao);
	}
}
